package com.sunk.test;

import java.util.ArrayList;
import java.util.concurrent.Semaphore;
import java.util.concurrent.locks.ReentrantLock;

public class OOMDump {

	static class OOMIntsmaze {
		Semaphore
		public byte[] placeholder = new byte[64 * 1024];
	}

	public static void fillHeap(ArrayList<OOMIntsmaze> list, int num) throws Exception {

		for (int i = 0; i < num; i++) {
			list.add(new OOMIntsmaze());
			System.out.println(i);
		}
	}

	public static void main(String[] args) throws Exception {
		ArrayList<OOMIntsmaze> list = new ArrayList<OOMIntsmaze>();
		fillHeap(list,131);
//		Thread.sleep(20000000);
		list.add(new OOMIntsmaze());
		list.add(new OOMIntsmaze());
		list.add(new OOMIntsmaze());
		list.add(new OOMIntsmaze());
		list.add(new OOMIntsmaze());

	}
}